package net.oschina.jhssm.module.system.service.impl;

import net.oschina.jhssm.common.service.impl.BaseServiceImpl;
import net.oschina.jhssm.module.system.dao.SysUserMapper;
import net.oschina.jhssm.module.system.entity.SysUser;
import net.oschina.jhssm.module.system.service.ISysUserService;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * Created by zhaojb on 2017/8/19.
 */
@Service
public class SysUserServiceImpl extends BaseServiceImpl<SysUser> implements ISysUserService {

    private SysUserMapper sysUserMapper;

    public SysUserServiceImpl(SysUserMapper sysUserMapper) {
        super.baseMapper = sysUserMapper;
        this.sysUserMapper = sysUserMapper;
    }

    @Override
    public SysUser findUserByUsername(String username) {
        return sysUserMapper.findUserByUsername(username);
    }

    @Override
    public Set<String> findRolesByUsername(String username) {
        return sysUserMapper.findRoleByUsername(username);
    }

    @Override
    public Set<String> findPermissionsByUsername(String username) {
        return sysUserMapper.findPermissionByUsername(username);
    }
}
